package top.aicey.ai.sparring.common.utils;

import top.aicey.ai.sparring.common.holder.RequestHeaderHolder;
import top.aicey.ai.sparring.dto.model.BaseRequestHeader;

public class BaseRequestUtil {

    public static void initRequest(Object request) {
        BaseRequestHeader requestHeader = RequestHeaderHolder.getRequestHeader();
        if (requestHeader != null && request != null && request instanceof BaseRequestHeader) {
            BaseRequestHeader baseRequestHeader = (BaseRequestHeader)request;
            baseRequestHeader.setRequestId(requestHeader.getRequestId());
            baseRequestHeader.setLanguage(requestHeader.getLanguage());
        }
    }
}
